from ultralytics import YOLO
import os

os.environ["KMP_DUPLICATE_LIB_OK"] = "TRUE"

if __name__ == "__main__":
    # 红外20251016
    # model_path = r"E:\zhihao\2025文档\25年10月\ai_训练\权重\public_security\infrared_detection\20251016\train4\weights\best.pt"
    # valid_yaml = r"E:\zhihao\2025文档\25年10月\ai_训练\验证集\public_security\infrared_detection\20251016\data.yaml"


    # 红外20251020 v1
    # model_path = r"E:\zhihao\2025文档\25年10月\ai_训练\权重\public_security\infrared_detection\20251020\v1\train5\weights\best.pt"
    # valid_yaml = r"E:\zhihao\2025文档\25年10月\ai_训练\验证集\public_security\infrared_detection\20251016\data.yaml"


    # 红外20251020 v2
    model_path = r"E:\zhihao\2025文档\25年10月\ai_训练\权重\public_security\infrared_detection\20251020\v2\train6\weights\best.pt"
    valid_yaml = r"E:\zhihao\2025文档\25年10月\ai_训练\验证集\public_security\infrared_detection\20251016\data.yaml"



    # Load the model
    model = YOLO(model_path)

    # Run the evaluation
    # 验证精度
    results = model.val(data=valid_yaml, classes=[0], iou=0.3, batch=9)
    # 验证测试
    # results = model.predict(data=valid_yaml, classes=[0], iou=0.3, batch=9)
